package com.heima.controller;

import com.heima.service.ITbOrderService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/order-service/report")
public class ReportController {

    @Autowired
    private ITbOrderService orderService;

    @GetMapping("/orderCount")
    @ApiOperation("查询当月订单总量")
    public Long getOrderCount(@RequestParam String start, @RequestParam String end) {
       return orderService.getOrderCount(start,end);
    }

    @GetMapping("/orderAmount")
    @ApiOperation("查询当月销售额")
    public Long getOrderAmount(@RequestParam String start, @RequestParam String end){
        return orderService.getOrderAmount(start,end);
    }
}
